﻿Imports System.Drawing.Design
Imports System.Windows.Forms.Design

Public Class UIFileEditor
    Inherits System.Drawing.Design.UITypeEditor
    Public Overrides Function GetEditStyle(context As System.ComponentModel.ITypeDescriptorContext) As UITypeEditorEditStyle
        Return UITypeEditorEditStyle.Modal
    End Function
    Public Overrides Function EditValue(context As System.ComponentModel.ITypeDescriptorContext, provider As IServiceProvider, value As Object) As Object
        'Return MyBase.EditValue(context, provider, value)
        Dim f As New frmFileOpen
        Dim frmsvr As IWindowsFormsEditorService = DirectCast(provider.GetService(GetType(IWindowsFormsEditorService)), IWindowsFormsEditorService)
        frmsvr.ShowDialog(f)
        Return f.FileName
    End Function
End Class
